package com.slkj.shilixiaoyuanapp.net.service;

import com.slkj.shilixiaoyuanapp.entity.BxDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.DisciplineHisEntity;
import com.slkj.shilixiaoyuanapp.entity.GradeEntity;
import com.slkj.shilixiaoyuanapp.entity.KqSsDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.MaterialAuditEntity;
import com.slkj.shilixiaoyuanapp.entity.MyApprovalHisEntity;
import com.slkj.shilixiaoyuanapp.entity.NoticeDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.RepairDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.SthdTypeAllEntity;
import com.slkj.shilixiaoyuanapp.entity.SthdTypeEntity;
import com.slkj.shilixiaoyuanapp.entity.StudentAttendanceEntity;
import com.slkj.shilixiaoyuanapp.entity.StudentWorksEntity;
import com.slkj.shilixiaoyuanapp.entity.StudentAttendanceHisEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolOfficialSealDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.HomeWorkDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.HomeWorkInfoEntity;
import com.slkj.shilixiaoyuanapp.entity.KnowledgeAllEntity;
import com.slkj.shilixiaoyuanapp.entity.MeetSqrAndPeopleEntity;
import com.slkj.shilixiaoyuanapp.entity.PeopleEntity;
import com.slkj.shilixiaoyuanapp.entity.PunchClockHistoryEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolCommonHistoryEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolLeaveEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolMeetingDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolNoticeHistoryListEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolOfficialSealChoseEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolOutWorkDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolPurchaseDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolWorkListEntity;
import com.slkj.shilixiaoyuanapp.entity.ToolWplyDetailEntity;
import com.slkj.shilixiaoyuanapp.entity.WorksDetailsEntity;
import com.slkj.shilixiaoyuanapp.entity.WplySqrandBmEntity;
import com.slkj.shilixiaoyuanapp.net.CommonResult;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Url;

/**
 * Created  on 2018-07-31
 *
 * @author 唐开阔
 * @describe 工具接口
 */
public interface ToolService {
    /**
     * 考勤--打卡
     * @param title
     * @param address
     * @return
     */
    @FormUrlEncoded
    @POST("teacherWorkAtt/add.do")
    Observable<CommonResult<String>> dk(@Field("num") int num,@Field("title") String title, @Field("address") String address);

    /**
     * 考勤--打卡-历史记录
     * @param date
     * @return
     */
    @FormUrlEncoded
    @POST("teacherWorkAtt/findById.do")
    Observable<CommonResult<PunchClockHistoryEntity>> dkHistory(@Field("date") String date);

    /**
     * 考勤--议题-与会人员
     * @return
     */
    @GET("meeting/selectMeetingTeacher.do")
    Observable<CommonResult<MeetSqrAndPeopleEntity>> getMeetPeople();

    /**
     * 添加议题
     * @return
     */
    @FormUrlEncoded
    @POST("meeting/addMeeting.do")
    Observable<CommonResult<String>> addMeeting(@Field("body")String body, @Field("title")String title, @Field("place") String place, @Field("datetime")String datetime,@Field("auditor") String  auditor,@Field("teacherName") String  teacherName);


    /**
     * 布置作业-获取发布对象，+作业类型 + 科目
     * @return
     */
    @GET("homeWork/selectAssignHomeWork.do")
    Observable<CommonResult<HomeWorkInfoEntity>> getHomeWorkInfos();


    /**
     * 布置作业--获取知识点
     * @return
     */
    @FormUrlEncoded
    @POST("homeWork/selectKnowledge.do")
    Observable<CommonResult<List<KnowledgeAllEntity>>> getKnowledge(@Field("classId") int classId, @Field("subId") int subId);

    /**
     * 布置作业--获取知识点
     * @return
     */
    @FormUrlEncoded
    @POST("homeWork/addHomeWork.do")
    Observable<CommonResult<String>> sendHomeWork( @Field("classId") String classId,@Field("subjectId") int subjectId, @Field("homeWorkTypeId") int homeWorkTypeId,@Field("body")String body,@Field("endTime")String endTime, @Field("knowledgeId") int knowledgeId,@Field("image")String img);

    /**
     * 分页加载获取作业历史记录
     * @return
     */
    @FormUrlEncoded
    @POST("homeWork/SelectHomeWork.do")
    Observable<CommonResult<List<ToolWorkListEntity>>> getHomeWorkHistory(@Field("page") int page, @Field("count") int count);


    /**
     * 分页加载获取通知历史记录
     * @return
     */
    @FormUrlEncoded
    @POST("notice/sendHistry.do")
    Observable<CommonResult<List<ToolNoticeHistoryListEntity>>> getNoticeHistory(@Field("page") int page, @Field("count") int count);


    /**
     * 获取作业详情
     * @return
     */
    @FormUrlEncoded
    @POST("homeWork/SelectByHomeWorkStudent.do")
    Observable<CommonResult<HomeWorkDetailEntity>> getHomeWorkDetail(@Field("hId") int hId);



    /**
     * 获取打卡次数
     * @return
     */
    @GET("teacherWorkAtt/getNum.do")
    Observable<CommonResult<Integer>> getDkNum();




    /**
     * 分页加载获取行政工具通用历史记录
     * @param page
     * @param count
     * @param state
     * @param type
     * @return
     */
    @FormUrlEncoded
    @POST("audit/getAudit.do")
    Observable<CommonResult<List<ToolCommonHistoryEntity>>> getCommonHistory(@Field("page") int page, @Field("count") int count, @Field("state") String state, @Field("type") int type);


    @FormUrlEncoded
    @POST("auditMaterial/getAuditUser.do")
    Observable<CommonResult<List<ToolCommonHistoryEntity>>> getCommonHistory1(@Field("page") int page, @Field("count") int count, @Field("state") String state,@Field("startId") int startId);


    /**
     * 获取我的审批数据
     * @param page
     * @param count
     * @param state
     * @return
     */
    @FormUrlEncoded
    @POST("audit/getAuditUser.do")
    Observable<CommonResult<List<MyApprovalHisEntity>>> getMyApproval( @Field("startId") int startId,  @Field("page") int page, @Field("count") int count, @Field("state") String state);


    /**
     * 获取议题详情
     * @return
     */
    @FormUrlEncoded
    @POST("meeting/selectByIdMeeting.do")
    Observable<CommonResult<ToolMeetingDetailEntity>> getMettingDetail(@Field("id") int id);

    /**
     * 获取公章详情
     * @return
     */
    @FormUrlEncoded
    @POST("commonSeal/getCommonSeal.do")
    Observable<CommonResult<ToolOfficialSealDetailEntity>> getOfficialSealDetail(@Field("id") int id);


    /**
     * 获取报xiu详情
     * @return
     */
    @FormUrlEncoded
    @POST("auditRepair/getDetails.do")
    Observable<CommonResult<List<RepairDetailEntity>>> getRepairDetail(@Field("id") int id);


    /**
     * 获取报销详情
     * @return
     */
    @FormUrlEncoded
    @POST("auditReimbursement/getDetails.do")
    Observable<CommonResult<List<BxDetailEntity>>> getBaoxiaoDetail(@Field("id") int id);


    /**
     * 获取出差详情
     * @return
     */
    @FormUrlEncoded
    @POST("Evection/getAuditEvection.do")
    Observable<CommonResult<ToolOutWorkDetailEntity>> getCcDetail(@Field("id") int id);


    /**
     * 获取物品领用详情
     * @return
     */
    @FormUrlEncoded
    @POST("GoodsReceiving/getAuditGoodsReceiving.do")
    Observable<CommonResult<ToolWplyDetailEntity>> getWplyDetail(@Field("id") int id);

    /**
     * 获取采购员详情
     * @return
     */
    @FormUrlEncoded
    @POST("auditPurchaseDetailed/getDetails.do")
    Observable<CommonResult<ToolPurchaseDetailEntity>> getPurchaseDetail(@Field("id") int id);


    /**
     * 议题撤销
     * @return
     */
    @FormUrlEncoded
    @POST
    Observable<CommonResult<String>> toolDelete(@Url String url, @Field("id") int id);


    /**
     * 审核人员 + 公章类型
     * @return
     */
    @GET("commonSeal/selectCommonSealTypeAndAuditor.do")
    Observable<CommonResult<ToolOfficialSealChoseEntity>> getTypeAndAuditor();


    /**
     * 提交一个公章申请
     * @return
     */
    @FormUrlEncoded
    @POST("commonSeal/addCommonSeal.do")
    Observable<CommonResult<String>> commitOfficialSeal( @Field("commonRealDetail") String commonRealDetail,@Field("auditor") String auditor);


    /**
     * 催办
     * @return
     */
    @FormUrlEncoded
    @POST("audit/reminder.do")
    Observable<CommonResult<String>> cb( @Field("auditor") String auditor,@Field("id") int id);


    /**
     * 提交一个出差申请
     * @return
     */
    @FormUrlEncoded
    @POST("Evection/addAuditEvection.do")
    Observable<CommonResult<String>> addOutWork( @Field("site") String site,@Field("auditor") String auditor, @Field("startDate") String startDate,@Field("endDate") String endDate, @Field("duration") String duration,@Field("body") String body);


    /**
     * 出差获取申请人
     * @return
     */
    @GET("Evection/selectAuditEvectionAndAuditor.do")
    Observable<CommonResult<ArrayList<PeopleEntity>>> getCcSqr();

    /**
     * 物品领用-获取部门和申请人数据
     * @return
     */
    @GET("GoodsReceiving/selectAuditGoodsReceivingAndAuditor.do")
    Observable<CommonResult<WplySqrandBmEntity>> getWplySqr();


    /**
     * 提交一个物品领用申请
     * @return
     */
    @FormUrlEncoded
    @POST("GoodsReceiving/addAuditGoodsReceiving.do")
    Observable<CommonResult<String>> addWply( @Field("goods") String goods,@Field("auditor") String auditor, @Field("department") int department,@Field("amount") String amount, @Field("body") String body);

    /**
     * 通用获取审核员
     * @return
     */
    @FormUrlEncoded
    @POST("audit/getAuditor.do")
    Observable<CommonResult<ArrayList<PeopleEntity>>> getCommonSpr(@Field("type") int type);

    /**
     * 提交一个请假
     * @return
     */
    @FormUrlEncoded
    @POST("auditLeave/add.do")
    Observable<CommonResult<String>> addQj( @Field("type") int type, @Field("startTime") String startTime,@Field("endTime") String endTime,@Field("dateSize") String dateSize, @Field("body") String body, @Field("images") String images,@Field("auditor") String auditor);



    /**
     * 提交一个报修
     * @return
     */
    @FormUrlEncoded
    @POST("auditRepair/add.do")
    Observable<CommonResult<String>> addBx( @Field("detailed") String detailed,@Field("auditor") String auditor);

    /**
     * 提交一个报销
     * @return
     */
    @FormUrlEncoded
    @POST("auditReimbursement/add.do")
    Observable<CommonResult<String>> addBxiao( @Field("detailed") String detailed,@Field("auditor") String auditor);


    /**
     * 获取请假详情
     * @return
     */
    @FormUrlEncoded
    @POST("auditLeave/getDetails.do")
    Observable<CommonResult<ToolLeaveEntity>> getLeaveDetail(@Field("id") int id);


    /**
     * 发布一个通知
     * @return
     */
    @FormUrlEncoded
    @POST("notice/add.do")
    Observable<CommonResult<String>> addTz( @Field("type") int type, @Field("title") String title, @Field("body") String body, @Field("image") String images,@Field("file") String file,@Field("teacher") String teacher,@Field("student") String student);


    /**
     * 发布一个社区
     * @return
     */
    @FormUrlEncoded
    @POST("classDynamic/addClassDynamic.do")
    Observable<CommonResult<Object>> addCommunity(  @Field("body") String body, @Field("address") String address,@Field("remind") String remind,@Field("image") String image);

    /**
     * 获取通知详情
     */
    @FormUrlEncoded
    @POST("notice/getDetails.do")
    Observable<CommonResult<NoticeDetailEntity>> getNoticeDetail(@Field("id") int  id);


    /**
     * 打卡申诉详情-列表跳
     */
    @FormUrlEncoded
    @POST("teacherWorkAtt/getAppeal.do")
    Observable<CommonResult<KqSsDetailEntity>> getKqSsDetail(@Field("id") int  id);

    /**
     * 打卡申诉详情-消息跳
     */
    @FormUrlEncoded
    @POST("teacherWorkAtt/getDetails.do")
    Observable<CommonResult<KqSsDetailEntity>> getKqSsDetailByMessage(@Field("id") int  id);



    /**
     * 添加一个打卡异常申诉
     */
    @FormUrlEncoded
    @POST("teacherWorkAtt/addAppeal.do")
    Observable<CommonResult<String>> addKqSs(@Field("workAttendanceId") int  id,@Field("reason")String reason,@Field("auditorId")String auditorId,@Field("image")String image,@Field("title")String title);


    /**
     * 社团活动获取比例
     */
    @GET("community/selectCommunityType.do")
    Observable<CommonResult<List<SthdTypeEntity>>> getSthd();


    /**
     * 所有社团及其人数
     */
    @GET("community/selectCommunityCountStudent.do")
    Observable<CommonResult<List<SthdTypeAllEntity>>> getSthdDetail();

    /**
     * 获取材料审核详情
     */
    @FormUrlEncoded
    @POST("auditMaterialAward/getDetails.do")
    Observable<CommonResult<MaterialAuditEntity>> getMaterialAuditDetails(@Field("id") int  id);



    /**
     * 审核申请
     * auditId
     * state
     * refute
     */
    @FormUrlEncoded
    @POST("audit/updateAudit.do")
    Observable<CommonResult<String>> spDo(@Field("id") int  id,@Field("auditId") int  auditId,@Field("state") int  state,@Field("refute") String  refute);

    /**
     * 所有年级所有班级
     * @param type 类型1 卫生检查  2 纪律检查 3 大课间
     * @return
     */
    @FormUrlEncoded
    @POST("inspect/selectClass.do")
    Observable<CommonResult<List<GradeEntity>>> getAllClass(@Field("type") int  type);
    /**
     * 添加数据
     * @param type 类型1 卫生检查  2 纪律检查 3 大课间
     * @return
     */
    @FormUrlEncoded
    @POST("inspect/add.do")
    Observable<CommonResult<String>> addInspect(@Field("type") int  type,@Field("scoreList")String scoreList);

    /**
     * 历史记录
     * @param date
     * @param type 类型1 卫生检查  2 纪律检查 3 大课间
     * @return
     */
    @FormUrlEncoded
    @POST("inspect/selectInspect.do")
    Observable<CommonResult<List<DisciplineHisEntity>>> inspectHistory(@Field("type") int  type, @Field("date") String date);

    /**
     * 学生考勤-获取名单
     * @return
     */
    @GET("Checkingin/selectStudent.do")
    Observable<CommonResult<StudentAttendanceEntity>> getAllStudent();

    /**
     * 添加一个学生考勤
     * @param classId
     * @param checkingList
     * @return
     */
    @FormUrlEncoded
    @POST("Checkingin/add.do")
    Observable<CommonResult<String>> addCheckingin(@Field("classId") int  classId, @Field("checkingList") String checkingList);


    /**
     * 学生考勤历史记录
     * @param  classId
     * @param  date
     * @return
     */
    @FormUrlEncoded
    @POST("Checkingin/selectStudentChecking.do")
    Observable<CommonResult<List<StudentAttendanceHisEntity>>> studentCheckingHistory(@Field("classId") int  classId, @Field("dates") String date);

    /**
     * 校园博物馆
     * @return
     * */
    @GET("Museum/selectMuseum.do")
    Observable<CommonResult<StudentWorksEntity>> schoolMuseum();

    /**
     * 作品详情
     * @param type
     * @param count
     * @param page
     * @param startId
     * @return
     * */
    @FormUrlEncoded
    @POST("Museum/selectMuseumStu.do")
    Observable<CommonResult<List<WorksDetailsEntity>>> worksDetails(@Field("type") int type,@Field("count") int count,@Field("page") int page,@Field("startId") int startId);

    /**
     * 获取物品领用部门
     * @return
     * */
    @GET("auditPurchaseDetailed/selectDepartment.do")
    Observable<CommonResult<List<WplySqrandBmEntity.DepartmentEntity>>> getBuMen();


    /**
     * 添加一条采购
     * @param auditor
     * @param detailed
     * @return
     */
    @FormUrlEncoded
    @POST("auditPurchaseDetailed/add.do")
    Observable<CommonResult<String>> addPurchaseDetailed(@Field("auditor") String auditor,@Field("detailed") String detailed);

    /**
     * 催交提醒
     * @param id
     * @return
     */
    @FormUrlEncoded
    @POST("homeWork/selectClassHomeWork.do")
    Observable<CommonResult<String>> cjtx(@Field("id") int id);

    /**
     * 阅读提醒
     * @param id
     * @return
     */
    @FormUrlEncoded
    @POST("notice/remindRead.do")
    Observable<CommonResult<String>> ydtx(@Field("id") int id);

    /**
     * 材料审核
     *
     * */
    @FormUrlEncoded
    @POST("auditMaterial/updateAudit.do")
    Observable<CommonResult<String>> materialReview(@Field("id") int  id,@Field("auditId") int  auditId,@Field("state") int  state,@Field("refute") String  refute);
}
